<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layuiAdmin 网站用户</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/admin/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/admin/layuiadmin/style/admin.css" media="all">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">

                <div class="layui-inline">
                    <label class="layui-form-label">开始时间</label>
                    <div class="layui-input-block">
                        <input type="text" name="str" placeholder="请输入" id="time1" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">结束时间</label>
                    <div class="layui-input-block">
                        <input type="text" name="end" placeholder="请输入" id="time2" autocomplete="off" class="layui-input">
                    </div>
                </div>



                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="LAY-user-front-search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </div>

        <div class="layui-card-body">


            <table class="layui-table" lay-data="{ url:'/admin/Admin/actionlog',method:'post', page:true, id:'LAY-user-managet'}" lay-filter="LAY-user-managet">
                <thead>
                <tr>
                    <th lay-data="{type: 'checkbox', fixed: 'left'}"></th>
                    <th lay-data="{field:'id', width:120, sort: true}">ID</th>
                    <th lay-data="{field:'user'}">操作用户</th>
                    <th lay-data="{field:'text'}">内容</th>
                    <th lay-data="{field:'ip'}">ip地址</th>
                    <th lay-data="{field:'addtime', sort: true,templet:'#addtime'}">操作时间</th>
                </tr>
                </thead>
            </table>
            <!--模版区-->
            <script type="text/html" id="lastlogin">
                {{# if(d.lastlogin){ }}
                {{getLocalTime(d.lastlogin)}}
                {{# }else{ }}
                从未登录
                {{# } }}
            </script>
            <script type="text/html" id="vip">
                {{# if(d.gid==0){ }}
                商户
                {{# }else if(d.gid==1){ }}
                超级管理员
                {{# } }}
            </script>
            <script type="text/html" id="addtime">
                {{# if(d.addtime){ }}
                {{getLocalTime(d.addtime)}}
                {{# }else{ }}
                无
                {{# } }}
            </script>
        </div>
    </div>
</div>

<style>
    select{
        border: none;
        appearance: none;
        -moz-appearance: none;
        -webkit-appearance: none;
    }
    select::-ms-expand { display: none; }
</style>
<script src="/admin/js/public.js"></script>
<script src="/admin/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/admin/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'useradmin', 'table','laydate'], function(){
        var $ = layui.$
            ,admin = layui.admin
            ,element = layui.element
            ,layer = layui.layer
            ,form = layui.form
            ,table = layui.table
            ,laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#time1' //指定元素
            ,type: 'datetime'
        });
        //执行一个laydate实例
        laydate.render({
            elem: '#time2' //指定元素
            ,type: 'datetime'
        });
        element.render();
        //监听搜索
        form.on('submit(LAY-user-front-search)', function(data){
            var field = data.field;

            $.post("{:url('admin/Admin/actionlog')}", field, function(data,state){});
            //执行重载
            table.reload('LAY-user-managet', {
                where: field
            });
        });


        $('.layui-btn.layuiadmin-btn-useradmin').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });





</script>
</body>
</html>
